home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
os2
/
lxlt115.zip
/
LXUTIL.ENG
< prev
next >
Wrap
Text File
|
1996-06-19
|
17KB
|
306 lines
───────────────────────────────────
lxLite utility pack
───────────────────────────────────
1.Abstract
──────────
Some time after releasing version 1.01 of lxLite (i.e. 1.0.1) (and some
time before :-) I wrote some simple command-line utilites which greatly
simplified my life. Because apart from lxLite they don`t present nothing
interesting, I included them here for you to get them along with lxlite :-)
2.unLock
────────
unLock is a simple utility which allows to `unlock` application
executables which is currently in use. Normally when an executable is
loaded by OS/2 its file is open with a deny-write sharing mode. This is done
because LX format structure is designed not to swap out unused pages in
executables each time when they aren`t needed anymore, but rather to discard
them. When discardrd page is needed OS/2 simply reads it again from
executable.
However, there is still a way to replace executables `on-the-fly` even if
they are currently running. There is an so-called `well-known undocumented`
function (which in fact means that it won`t be neccesarily supported in
future versions of OS/2) which allow to disable sharing protection on such
files. Before doing that OS/2 reads entire executable in swap file, then
page swapping is done as with usual memory. If you`ll `unlock` many running
executables at the same time you can notice an increase in swap file size.
So, this is just an temporary work-around, you have better to reboot after
doing all neccesary things on former locked files.
The command-line format of unLock is much like lxLite`s, except that it
have much less options :-)
/E{+|-} r[E]cursive (+) file search through subdirectories
unLock will recursively search any directories which is
located below the directory of given filemask. If multiple
masks are given multiple recursive searchs will be performed.
/P{+|-} Enable (+) or disable (-) pause before each file
Before each file chCase will ask you whenever you really want
to unlock the file.
/V{+|-} Verbose (show a lot of additional information)
If verbose option is disabled (/V-) only those messages are
left on screen which displays critical messages (i.e. errors),
otherwise after each filename unLock shows the result of unlock
operation - 'unlocked' or 'sharing violation'. Note that unLock
CANNOT unlock files which are locked in some other way than
executbles.
/?,/H Show a short help screen
3.chCase
────────
Some time ago I was finally bored of the annoying habbit of some programs
to write their files in upper case. And not only contents (almost any
program which changes config.sys tends to convert it all to upper case when
I like it to be in lower case) but filenames also. So i started this little
project as a problem-dedicated-and-easy-to-use replacement for REN command.
The main ideology of chCase is to divide filename in some `parts` then to
perform some case-conversions on each part apart :-) You can define `part
separator` characters using /S"" option. By default chCase uses "." as `part
separator`. I.e. filename chcase.is.a.great.prog will be divided into parts
'chcase', 'is', 'a', 'great' and 'prog'. Further you can tell chCase to
convert first part to upper-case, second - to lower-case, third - to mixed
format (i.e. first letter in uppercase and rest in lowercase) and so on.
The available options are:
/C{#{.}} Convert to [L]ower/[U]pper/[M]ixed/[A]s-is case
You can define multiple `case conversion actions` - first one
will be applied on the first `part`; second - on the second
`part` and so on. Last `action` will be used for any extra
encountered `parts`, so if you`ll define only one option it
will be applyed on all filename parts. Some examples:
filename command line resulting filename
───────────────────────┬────────────────┬────────────────────────
mY.Very.lOnG.fIlE.NamE │/culam my* │MY.very.lOnG.File.Name
just.an.example │/cml jus* │Just.an.example
leT.iT.bE │/cmla let* │Let.it.bE
/E{+|-} r[E]cursive (+) file search through subdirectories
chCase will recursively search any directories which are
located below the directory of given filemask. If multiple
masks are given multiple recursive searchs will be performed.
/P{+|-} Enable (+) or disable (-) pause before each file
Before each file chCase will ask you whenever you really want
to rename this file. The initial and final filenames are
displayed.
/S"{#}" Define separator character(s) OVER old ones
You can use this switch in the case when you have some files
which uses some other separators, for example space or
underscore. Note that the /S switch is NOT additive i.e.
any /S switch disables the action of precedent. Even "."
is cleared by /S switch, so if you for example want to use
as separators both "." and space " " you have to define them
both in a single /S switch as follows: /S" ."
Just some examples:
filename command line resulting filename
───────────────────────┬────────────────┬────────────────────────
Mary has a Little.Lamb │/cm /s" ." mar* │Mary Has A Little.Lamb
john_wAs_a_lItTle_lame │/cuml /s"_" │JOHN_Was_a_little_lame
/V{+|-} Verbose (show a lot of additional information)
If you will specify /V- chcase will leave on screen only
critical messages such as errors - all others will be cleared
immediately after they succeeded.
/?,/H Show a short help screen
4.colMng
────────
ColMng is a simple utility which will allow you to manipulate PM color
palettes, in particular to save, restore, copy them from file to file as
well as copying them inside the same .INI file. All color palettes which are
visible in Scheme Palette are a entry in OS2SYS.INI; i.e. to copy color
palette from one system to another you have to save the needed entry into a
separate .INI file and to `load` color palette on target machine. Now some
words about how and where the palettes are saved: The `default` palette is
kept as a 'PM_Default_Colors` entry in OS2.INI file; it has the same
format as other palettes: the only difference between them is that most
palettes resides in OS2SYS.INI but default colors are kept in OS2.INI. The
entry has a lot of subentries such as `ShadowHiliteBgnd', 'FieldBackground',
'DesktopText` and so on.
Along with PM_Default_Colors there is another palette entry in OS2.INI
called PM_Colors. What is the difference between them? As far as I observed
PM_Default_Colors is the palette which is used when you load some other
shell replacement (not WPS), and PM_Colors seems to be used only when
WorkPlaceShell is loaded. Note that any change regarding system colors will
act only after reboot. There is a way to set colors directly, but I use
ColMng seldom and don`t bother about this :-)
ColMng is a command-line utility which have a lot of options (I already said
that I like them :-) They are:
/C{#} Set custom palette. To view a list of available palettes use blank
palette name. If you specify a name after /C this will copy specified
PM_# entry from OS2SYS.INI into PM_Default_Colors entry of OS2.INI file.
If you are using WorkPlace Shell you will not notice changes without
removing the PM_Colors entry (see /D option).
/S{#} Save color palette into resource file; empty name for default palette.
The specified palette (for example PM_Khaki_Colors) will be saved into
specified in command line file. The file will have a regular .INI
structure. For example ColMng /S mycols.ini will save PM_Default_Colors
entry into file `myco